<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">我的浏览</view>
		</view>	
		<view class="bg_box">
			<view class="bg_content">
				<!-- <scroll-view class="scroll_box" scroll-y="true" @scrolltolower="lower"> -->
					<block v-for="(item,index) in info">
						<view class="goods_list">
							<view class="goods_img" :data-url="url+item.out_id" @click="gotopage">
								<image :src="item.logo" mode="scaleToFill" v-if="item.logo"></image>
							</view>
							<view class="goods_text">
								<view class="title" :data-url="'/pages/goods/goods?id='+item.out_id" @click="gotopage">{{item.content}}</view>
								<view class="text">{{item.subtitle}}</view>
								<view class="money_box">
									<view class="money">{{item.market_price}}</view>
									<view class="rule">浏览日期：{{item.updated_at}}</view>
								</view>
							</view>
						</view>
					</block>
					<view style="text-align: center;padding-top: 5vw;margin-bottom: 5vw;" v-if="empty">
						<u-empty text="暂无数据" mode="list">没有更多了</u-empty>
					</view>	
				<!-- </scroll-view> -->
				
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,
				scrrol:false,
				info:'',
				select:0,
				type:0,
				avatar:'',
				nickname:'',
				is_store:'',
				is_sm:0,
				wholesale:0,
				dynamics:0,
				want:0,
				url:'/pages/goods/goods?id=',
				empty:0,
			}
		},
		onLoad() {
			this.loadList();
		},
		methods: {
			setRule(e){
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.flowList[index].tick = !that.flowList[index].tick
			},
			loadList(){
				let that = this;
				that.Net._get('auth/team/view_list', {page:that.page,type:that.type}, res => {
					if (res.code == 1) {
						that.info = res.data;
						if (that.info.length == 0){
							that.empty =1;
						}
					}
				});
			},
			collect(id){
				let that = this;
				that.Net._post('auth/team/collect', {id:id,is_type:that.type}, res => {
					if (res.code == 1) {
						that.Msg.Success('取消成功', res => {
							that.page = 1;
							that.loadList();
						});
					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},

		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onReachBottom() {
			var that = this;
			that.page++;
			that.Net._get('auth/team/collection', {page:that.page,type:that.type}, res => {
				if (res.code == 1) {
					if (res.data == '') {
						uni.showToast({
							title: '没有更多了',
							duration: 2000,
							icon: 'none'
						});
						that.empty =1;
					} else {
						that.info = that.info.concat(res.data); //将数据拼接在一起
					}
				} else if (res.code == 0) {
					that.Msg.Success(res.msg, res => {});
				}
			});
		},
	}
</script>

<style>
	
	.header{
		background-color: transparent !important;
		height: 18vw !important;
	}
	
	.header .text{
		background-color: transparent !important;
		color: #333 !important;
	}
	
	.header .back{
		color: #333 !important;
	}
	
	.scrrolHeader{
		background-color: #F9E9E3 !important;
	}
	
	.bg_box{
		width: 100%;
		position: relative;
	}
	
	.bg_box .bg01{
		width: 100%;
	}
	
	.bg_box .bg_content{
		width: 92%;
		position: absolute;
		left: calc(50% - 46%);
		top: calc(13.5vw + var(--status-bar-height));
		z-index: 98;
	}
	
	.name_box {
		width: 100%;
		margin-top: 4%;
		display: flex;
		align-items: center;
	}
	
	.name_box .avatar {
		width: 18vw;
		height: 18vw;
		margin-right: 4%;
		margin-left: 4%;
		background-color: #fff;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.name_box .avatar image {
		width: 90%;
		height: 90%;
		border-radius: 50%;
	}
	
	.name_box .name_text {
		flex: 1;
	}
	
	.name_box .name_text .name {
		font-size: 5vw;
		color: #333;
		font-weight: bold;
	}
	
	.name_box .name_text .realname {
		margin-top: 2vw;
		display: flex;
	}
	
	.name_box .name_text .realname .real {
		height: 7vw;
		padding: 0 2vw 0 3vw;
		border-radius: 7vw;
		background-color: #FC5D20;
		display: flex;
		align-items: center;
	
	}
	
	.name_box .name_text .realname .real .t {
		font-size: 3vw;
		color: #fff;
		
	}
	
	.name_box .name_text .realname .real .r {
		font-size: 2.7vw;
		color: #fff;
		margin-right: 1vw;
	}
	
	.name_box .message {
		position: relative;
		margin-right: 4%;
	}
	
	.name_box .message .icon {
		font-size: 8vw;
		color: #333;
	}
	
	.name_box .message .round {
		height: 3vw;
		width: 3vw;
		box-sizing: border-box;
		border-radius: 50%;
		text-align: center;
		position: absolute;
		right: 0vw;
		top: 0;
		background-color: #FC5D20;
		color: #fff;
	}
	
	.menu_box {
		width: 100%;
		margin: 0 auto;
		display: flex;
		padding: 6vw 0;
		border-radius: 2vw;
		margin-top: 4%;
		background-color: #fff;
		border-radius: 3vw;
	}
	
	.menu_box .menu {
		flex: 1;
	}
	
	.menu_box .menu .num {
		font-size: 5vw;
		font-weight: bold;
		color: #1d1f24;
		text-align: center;
	}
	
	.menu_box .menu .text {
		font-size: 3.2vw;
		color: #7C8191;
		text-align: center;
		margin-top: 1vw;
	}
	
	.scroll_box {
		width: 100%;
		height: 63vh;
		margin-top: 4%;
	}
	
	.goods_list {
		width: 100%;
		display: flex;
		margin-bottom: 4%;
	}
	
	.goods_list .goods_img {
		width: 32vw;
		height: 25vw;
		margin-right: 3vw;
	}
	
	.goods_list .goods_img image {
		width: 100%;
		height: 100%;
		border-radius: 2vw;
	}
	
	.goods_list .goods_text {
		flex: 1;
	}
	
	.goods_list .goods_text .title {
		font-size: 4vw;
		color: #333;
		font-weight: bold;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
	
	.goods_list .goods_text .text {
		font-size: 3.5vw;
		color: #999999;
		margin-top: 2vw;
	}
	
	.goods_list .goods_text .money_box {
		margin-top: 1vw;
		display: flex;
		align-items: center;
	}
	
	.goods_list .goods_text .money_box .money {
		font-size: 4.5vw;
		font-weight: bold;
		color: #FF6826;
		flex: 1;
	}
	
	.goods_list .goods_text .money_box .rule {
		font-size: 3vw;
		color: #999999;
		/* flex: 1; */
		text-align: right;
	}
	
	.nav {
		width: 100%;
		height: 13.5vw;
		overflow: hidden;
		overflow-x: auto;
		box-sizing: border-box;
	}
	
	.nav .navauto {
		width: 100%;
		display: flex;
		/* margin-left: 4%; */
		min-width: 100%;
	}
	
	.nav .navauto .menu {
		width: 50%;
		position: relative;
	}
	
	.nav .navauto .menu .text {
		font-size: 4.2vw;
		color: #666666;
		text-align: center;
		line-height: 13.5vw;
	}
	
	.nav .navauto .menu .line {
		width: 20%;
		border-radius: 3vw;
		position: absolute;
		left: calc(50% - 10%);
		bottom: 1vw;
		display: none;
	}
	
	.nav .navauto .menu .line image{
		width: 100%;
	}
	
	.menucolor {
		color: #091624 !important;
		font-weight: bold;
		font-size: 4.4vw !important;
	}
	
	.menucolor02 {
		display: block !important;
	}
	
	.menucolor03 {
		background-color: #FF9822 !important;
	}
	
	
	
	
</style>
